/**
*      author: Y_Yao
*      created: 2025-02-07 20:06:47
**/

#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 1e18;
const int INF = 0x3f3f3f3f;
const int N = 2e5 + 7;
int n,w;
int ans[N];
int cnt[N];

struct node
{
    int x,id;
};

bool cmp(node& t1,node& t2)
{
    return t1.x < t2.x;
}

void solve()
{
    cin >> n >> w;
    memset(ans,-1,sizeof ans);
    vector<vector<node>> a(w + 1);
    for(int i = 1;i <= n;i++)
    {
        int X,Y;
        cin >> Y >> X;
        cnt[Y]++;
        a[Y].push_back({X,i});
    }

    int num = INF;
    for(int i = 1;i <= w;i++)
    {
        num = min(num,cnt[i]);
        sort(a[i].begin(),a[i].end(),cmp);
    }

    for(int i = 0;i < num;i++)
    {
        int c = 0;
        for(int j = 1;j <= w;j++)
        {
            c = max(c,a[j][i].x);
        }

        for(int j = 1;j <= w;j++)
        {
            ans[a[j][i].id] = c;
        }  
    }

    int q;
    cin >> q;
    while(q--)
    {
        int T,A;
        cin >> T >> A;
        if(ans[A] == -1) cout << "Yes" << endl;
        else if(T >= ans[A]) cout << "No" << endl;\
        else cout << "Yes" << endl;
    }
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}